package me.a08impdemo8;

public class Test {
    public static void main(String[] args) {
        Ping p = new Ping("张三", 18);
        p.study();
        p.speak();
        System.out.println(p.getName());
        System.out.println(p.getAge());

    }
}

abstract class Person {
    private String name;
    private int age;

    public Person() {
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }
}

abstract class Sporter extends Person {
    public Sporter() {
    }

    public Sporter(String name, int age) {
        super(name, age);
    }

    public abstract void study();
}

abstract class Coach extends Person {
    public Coach() {
    }

    public Coach(String name, int age) {
        super(name, age);
    }

    public abstract void teach();
}

class Ping extends Sporter implements English {
    public Ping() {
    }

    public Ping(String name, int age) {
        super(name, age);
    }

    @Override
    public void speak() {
        System.out.println("说英语");
    }

    @Override
    public void study() {
        System.out.println("学打乒乓球");
    }
}

class Bask extends Sporter {
    public Bask() {
    }

    public Bask(String name, int age) {
        super(name, age);
    }

    @Override
    public void study() {
        System.out.println("学打篮球");
    }
}

class PingpC extends Coach implements English {
    public PingpC() {
    }

    public PingpC(String name, int age) {
        super(name, age);
    }

    @Override
    public void teach() {
        System.out.println("教打乒乓球");
    }

    @Override
    public void speak() {
        System.out.println("说英语");
    }
}

class BaskC extends Coach {
    public BaskC() {
    }

    public BaskC(String name, int age) {
        super(name, age);
    }

    @Override
    public void teach() {
        System.out.println("教打篮球");
    }
}
